package com.zou.lotterylucky.data

import org.json.JSONObject
import java.io.Serializable

class RedeemItem(obj: JSONObject) : Serializable {
    var date = obj["date"] as String
    var betMoney = obj.getDouble("bet_money")
    var subTotal = obj.getDouble("sub_total_bet_money")
    var commission = obj.getDouble("commission")
    var prizes = obj.getDouble("prizes")
    var redeemAmount = obj.getDouble("redemption_amount")

    fun getCommissionValue(): Double {
        return (subTotal * commission) / 100
    }

    fun getSettlement(): Double {
        return subTotal - getCommissionValue() - prizes
    }
}